#include "stdafx.h"
#include "ValidatorBase.h"
#include "CombatDef.h"

struct  ValidatorsDefReflectionRegister
{
	ValidatorsDefReflectionRegister()
	{
		REGISTER_REFLECTION_MEMBER(TContextValidators,m_iID,INVALID_ID).Editor_SetAsPrimaryKey();
		REGISTER_REFLECTION_MEMBER(TContextValidators,m_sDisplayName,std::string("DefaultName")).Editor_SetAsDisplayName();

		REGISTER_REFLECTION_MEMBER(TContextValidators,m_iTurnNum,(uint32)0).Editor_SetAsRaw("TurnNum");
		REGISTER_REFLECTION_MEMBER(TContextValidators,m_eTurnNumCamp,eCompare_Null).Editor_SetAsEnumation<ECompare>("TurnNum");


		REGISTER_REFLECTION_MEMBER(TContextValidators,m_eLogicPot,ELogicOpt_NULL).Editor_SetAsEnumation<ELogicOpt>("CardNum & CardNum2");
		REGISTER_REFLECTION_MEMBER(TContextValidators,m_tiBeOurSide,eTriple_Null).Editor_SetAsEnumation<ETriple>("CardNum");
		REGISTER_REFLECTION_MEMBER(TContextValidators,m_eFieldType,ECardStorage_BattleField).Editor_SetAsEnumation<ECardStorage>("CardNum");
		REGISTER_REFLECTION_MEMBER(TContextValidators,m_vRaces,std::vector<int32>()).Editor_SetAsEnumationSet<ECardRace>("CardNum");
		REGISTER_REFLECTION_MEMBER(TContextValidators,m_vTypes,std::vector<int32>()).Editor_SetAsForeignKeySet(eDefGroup_Default,eDefaultDef_CardTypes,"CardNum");
		REGISTER_REFLECTION_MEMBER(TContextValidators,m_iCardNum,INVALID_ID).Editor_SetAsRaw("CardNum");
		REGISTER_REFLECTION_MEMBER(TContextValidators,m_eCardNumComp,eCompare_Null).Editor_SetAsEnumation<ECompare>("CardNum");;

		REGISTER_REFLECTION_MEMBER(TContextValidators,m_tiBeOurSide2,eTriple_Null).Editor_SetAsEnumation<ETriple>("CardNum2");
		REGISTER_REFLECTION_MEMBER(TContextValidators,m_eFieldType2,ECardStorage_BattleField).Editor_SetAsEnumation<ECardStorage>("CardNum2");
		REGISTER_REFLECTION_MEMBER(TContextValidators,m_vRaces2,std::vector<int32>()).Editor_SetAsEnumationSet<ECardRace>("CardNum2");
		REGISTER_REFLECTION_MEMBER(TContextValidators,m_vTypes2,std::vector<int32>()).Editor_SetAsForeignKeySet(eDefGroup_Default,eDefaultDef_CardTypes,"CardNum2");
		REGISTER_REFLECTION_MEMBER(TContextValidators,m_iCardNum2,INVALID_ID).Editor_SetAsRaw("CardNum2");
		REGISTER_REFLECTION_MEMBER(TContextValidators,m_eCardNumComp2,eCompare_Null).Editor_SetAsEnumation<ECompare>("CardNum2");;

		REGISTER_REFLECTION_MEMBER(TContextValidators,m_tiBeOurSideHeroHp,eTriple_Null).Editor_SetAsEnumation<ETriple>("HeroHP");
		REGISTER_REFLECTION_MEMBER(TContextValidators,m_fHeroHpPercent,(double)0.f).Editor_SetAsRaw("HeroHP");
		REGISTER_REFLECTION_MEMBER(TContextValidators,m_eHeroHpComp,eCompare_Null).Editor_SetAsEnumation<ECompare>("HeroHP");

		REGISTER_REFLECTION_MEMBER(TContextValidators,m_tiBeOurSideHeroSp,eTriple_Null).Editor_SetAsEnumation<ETriple>("HeroSP");
		REGISTER_REFLECTION_MEMBER(TContextValidators,m_iHeroSp,0).Editor_SetAsRaw("HeroSP");
		REGISTER_REFLECTION_MEMBER(TContextValidators,m_eHeroSpComp,eCompare_Null).Editor_SetAsEnumation<ECompare>("HeroSP");

		REGISTER_REFLECTION_MEMBER(TContextValidators,m_tiBeOurSideTombLock,eTriple_Null).Editor_SetAsEnumation<ETriple>("TombLock");
		REGISTER_REFLECTION_MEMBER(TContextValidators,m_bLock,false).Editor_SetAsRaw("TombLock");


		REGISTER_REFLECTION_MEMBER(TEachValidators,m_iID,INVALID_ID).Editor_SetAsPrimaryKey();
		REGISTER_REFLECTION_MEMBER(TEachValidators,m_sDisplayName,std::string("DefaultName")).Editor_SetAsDisplayName();
		REGISTER_REFLECTION_MEMBER(TEachValidators,m_eHpCompare,eCompare_Null).Editor_SetAsEnumation<ECompare>();
		REGISTER_REFLECTION_MEMBER(TEachValidators,m_eHpMaxCompare,eCompare_Null).Editor_SetAsEnumation<ECompare>();
		REGISTER_REFLECTION_MEMBER(TEachValidators,m_tiBeSameRace,eTriple_Null).Editor_SetAsEnumation<ETriple>();
		REGISTER_REFLECTION_MEMBER(TEachValidators,m_tiBeSelf,eTriple_Null).Editor_SetAsEnumation<ETriple>();
		REGISTER_REFLECTION_MEMBER(TEachValidators,m_tiBeSameSide,eTriple_Null).Editor_SetAsEnumation<ETriple>();
		REGISTER_REFLECTION_MEMBER(TEachValidators,m_vHasBuffOfMine,std::vector<int32>()).Editor_SetAsForeignKeySet(eDefGroup_Default,eDefaultDef_ReactorTypes);
		REGISTER_REFLECTION_MEMBER(TEachValidators,m_vNotHasBuffOfMine,std::vector<int32>()).Editor_SetAsForeignKeySet(eDefGroup_Default,eDefaultDef_ReactorTypes);
		

		REGISTER_REFLECTION_MEMBER(TSkillValidators,m_iID,INVALID_ID).Editor_SetAsPrimaryKey();
		REGISTER_REFLECTION_MEMBER(TSkillValidators,m_sDisplayName,std::string("DefaultName")).Editor_SetAsDisplayName();
		REGISTER_REFLECTION_MEMBER(TSkillValidators,m_vTypeIn,std::vector<int32>()).Editor_SetAsForeignKeySet(eDefGroup_Default,eDefaultDef_ReactorTypes);
		REGISTER_REFLECTION_MEMBER(TSkillValidators,m_vTypeNotIn,std::vector<int32>()).Editor_SetAsForeignKeySet(eDefGroup_Default,eDefaultDef_ReactorTypes);
		REGISTER_REFLECTION_MEMBER(TSkillValidators,m_vCategoryMustInclude,std::vector<int32>()).Editor_SetAsForeignKeySet(eDefGroup_Default,eDefaultDef_ReactorCategory);
		REGISTER_REFLECTION_MEMBER(TSkillValidators,m_vCategoryMustNotInclude,std::vector<int32>()).Editor_SetAsForeignKeySet(eDefGroup_Default,eDefaultDef_ReactorCategory);

		REGISTER_REFLECTION_MEMBER(TObjValidators,m_iID,INVALID_ID).Editor_SetAsPrimaryKey();
		REGISTER_REFLECTION_MEMBER(TObjValidators,m_sDisplayName,std::string("DefaultName")).Editor_SetAsDisplayName();
		REGISTER_REFLECTION_MEMBER(TObjValidators,m_tiAliveOrDead,eTriple_Null).Editor_SetAsEnumation<ETriple>();
		REGISTER_REFLECTION_MEMBER(TObjValidators,m_vObjInStorages,std::vector<int32>()).Editor_SetAsEnumationSet<ECardStorage>();		
		REGISTER_REFLECTION_MEMBER(TObjValidators,m_vHasSkills,std::vector<int32>()).Editor_SetAsForeignKeySet(eDefGroup_Default,eDefaultDef_ReactorTypes,"HasSkill");
		REGISTER_REFLECTION_MEMBER(TObjValidators,m_vNotHasSkills,std::vector<int32>()).Editor_SetAsForeignKeySet(eDefGroup_Default,eDefaultDef_ReactorTypes,"HasSkill");
		REGISTER_REFLECTION_MEMBER(TObjValidators,m_vHasSkillInCategorys,std::vector<int32>()).Editor_SetAsForeignKeySet(eDefGroup_Default,eDefaultDef_ReactorCategory,"HasSkillInCategory");
		REGISTER_REFLECTION_MEMBER(TObjValidators,m_vRaceIn,std::vector<int32>()).Editor_SetAsEnumationSet<ECardRace>("Race");
		REGISTER_REFLECTION_MEMBER(TObjValidators,m_vRaceNotIn,std::vector<int32>()).Editor_SetAsEnumationSet<ECardRace>("Race");
		REGISTER_REFLECTION_MEMBER(TObjValidators,m_iFightTurnEqual,INVALID_ID).Editor_SetAsRaw();
		REGISTER_REFLECTION_MEMBER(TObjValidators,m_vObjTypeIn,std::vector<int32>()).Editor_SetAsEnumationSet<ECombatObj>("ObjType");
		REGISTER_REFLECTION_MEMBER(TObjValidators,m_vObjTypeNotIn,std::vector<int32>()).Editor_SetAsEnumationSet<ECombatObj>("ObjType");
		REGISTER_REFLECTION_MEMBER(TObjValidators,m_tiHpFullOrNot,eTriple_Null).Editor_SetAsEnumation<ETriple>("HPFull");
		REGISTER_REFLECTION_MEMBER(TObjValidators,m_eHpCompare,eCompare_Null).Editor_SetAsEnumation<ECompare>("HpCondition");
		REGISTER_REFLECTION_MEMBER(TObjValidators,m_iHpAbsValue,-1).Editor_SetAsRaw("HpCondition");
		REGISTER_REFLECTION_MEMBER(TObjValidators,m_fPercentValue,-1.f).Editor_SetAsRaw("HpCondition");
		
		REGISTER_REFLECTION_MEMBER(TObjValidators,m_iEachValidorFacedCard,INVALID_ID).Editor_SetAsForeignKey(eDefGroup_Default,eDefaultDef_ValidatorEach,"FacedObjCompare");
		
		GlobalClassManager::Instance().RegisterClass(TContextValidators::s_GetReflection(),eDefaultDef_ValidatorContext);
		GlobalDefManager::Instance().RegisterDefManger(&ValidatorContextManager::Instance());

		GlobalClassManager::Instance().RegisterClass(TEachValidators::s_GetReflection(),eDefaultDef_ValidatorEach);
		GlobalDefManager::Instance().RegisterDefManger(&ValidatorEachManager::Instance());

		GlobalClassManager::Instance().RegisterClass(TSkillValidators::s_GetReflection(),eDefaultDef_ValidatorSkill);
		GlobalDefManager::Instance().RegisterDefManger(&ValidatorSkillManager::Instance());

		GlobalClassManager::Instance().RegisterClass(TObjValidators::s_GetReflection(),eDefaultDef_ValidatorObj);
		GlobalDefManager::Instance().RegisterDefManger(&ValidatorObjManager::Instance());
	}
}__validatorsdefreflectionregister;

TEachValidators::~TEachValidators()
{
}


TSkillValidators::~TSkillValidators()
{
}

TObjValidators::~TObjValidators()
{
}

TContextValidators::~TContextValidators()
{

}